package cn.stimd.spring.jdbc.datasource;

import cn.stimd.spring.transaction.support.ResourceHolderSupport;

import java.sql.Connection;

/**
 * Created by Stimd
 * 项目地址：https://gitee.com/stimd/spring-wheel
 * 公众号：Java编程探微
 */
public class ConnectionHolder extends ResourceHolderSupport {
    //底层数据库连接
    private Connection connection;
    //是否事务存在的标记
    private boolean transactionActive = false;

    public ConnectionHolder(Connection connection) {
        this.connection = connection;
    }

    public Connection getConnection() {
        return connection;
    }

    public void setConnection(Connection connection) {
        this.connection = connection;
    }

    public boolean isTransactionActive() {
        return transactionActive;
    }

    public void setTransactionActive(boolean transactionActive) {
        this.transactionActive = transactionActive;
    }
}
